package edu.gatech.cs2340.thecyclonesquad;

import android.os.Build;
import android.os.Bundle;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.TextView;

public class AdminCreatedActivity extends Activity {

	@SuppressLint("NewApi")
	@Override
	/**
	 * Modified the default method in order to add a textview that states which admin user is created.
	 */
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_admin_created);
		// Make sure we're running on Honeycomb or higher to use ActionBar APIs
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            // Show the Up button in the action bar.
            getActionBar().setDisplayHomeAsUpEnabled(true);
        }
        //get username from intent
        Intent intent = getIntent();
        String username = intent.getStringExtra(CreateAdminActivity.NEWADMIN_MESSAGE);
        
        // Create the text view
        TextView textView = new TextView(this);
        textView.setTextSize(20);
        textView.setText("Admin " + username  + " has been created");

        // Set the text view as the activity layout
        setContentView(textView);
	}

	@Override
	/**
	 * Initialize the contents of the Activity's standard options menu.
	 */
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_admin_created, menu);
		return true;
	}

}
